def move(m, A, C):
    """将编号为m的圆盘从柱子A移动到柱子C"""
    print(f'移动{m}号圆盘，{A} ---> {C}')


def hanoi(n, A, B, C):
    """将n个圆盘从柱子A借助柱子B移动到柱子C"""
    if n == 1:
        # 将圆盘从柱子A移动到柱子C
        move(1, A, C)
    else:
        # 将柱子A上面编号为1至n-1的圆盘从柱子A借助柱子C移动到柱子B
        hanoi(n - 1, A, C, B)
        # 将柱子A最下面编号为n的圆盘从柱子A移动到柱子C
        move(n, A, C)
        # 将柱子B的n-1个圆盘从柱子B借助柱子A移动到柱子C
        hanoi(n - 1, B, A, C)


hanoi(3, 'A', 'B', 'C')